<html>
<head>
	<meta charset='utf-8' />
	<title>记事本</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<style>
		@media screen and (max-width:450px){
			#content{width:98%;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
		@media screen and (min-width:450px){
			#content{width:450px;margin:0 auto}
			/*页面宽度900以下时 .abc的宽度为450*/
		}
	</style>
</head>
<body style='padding:0;margin:0;background:#eee'>
<!-- 1 Content容器 -->
<div id='Content' style='border:0px solid'>
	
	<h1 style='text-align:center'>修改密码</h1>

	<div style='text-align:center'>
		<div>原密码：<input type="password" id='pwd1' /></div>
		<div style='margin:10px 0'>新密码：<input type="password" id='pwd2' /></div>
		<div>新密码：<input type="password" id='pwd3' /></div>
	</div>

	<div style='text-align:center;margin:30px'>
		<button id='submit'>提交</button>　
		<button onclick='history.go(-1)'>返回</button>
	</div>


</div><!-- 1 Content容器结束 -->


</body>
</html>
<script src='public/jquery.js'></script>
<script src='public/fun.js'></script>
<script>

CheckLoginBefore();		//### 检测前台登陆状态和token1

$(function(){
	$('#submit').click(function(){
		var pwd1 = $('#pwd1').val().trim();
		var pwd2 = $('#pwd2').val().trim();
		var pwd3 = $('#pwd3').val().trim();
		if(!pwd1 || !pwd2 || !pwd3){
			return;
		}
		if(pwd3 != pwd2){
			A('新密码不一致！');return;
		}
		if(pwd1 == pwd2){
			A('新旧密码不能相同！');return;
		}
		var data = {
			type:'reset_pwd',
			pwd1:pwd1,
			pwd2:pwd2
		}
		AjaxBefore(data,function(res){
			if(!/^{.*}$/.test(res)){
				A('请求异常！');
				reutnr;
			}
			var tmp = JSON.parse(res);
			sessionStorage.token1 = tmp.token1;
			if(tmp.stat == 'ok'){
				A('操作成功！');
				history.go(-1);
			}else{
				A('密码不正确！');
			}
		});
	});


});

</script>